package cn.sanshuilin.kst.system.provider.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2017-12-03 19:28
 * Copyright 2017  by 三水林科技有限公司
 **/
@Entity
@Table(name = "Rate")
public class Rate implements Serializable {
    private String id;
    private String pubMemberId;
    private String toMemberId;
    private Integer starId;
    private Date pubDate;
    private String comment;
    private String starName;
    private Member pubMember;

    @Transient
    public String getStarName() {
        return starName;
    }

    public void setStarName(String starName) {
        this.starName = starName;
    }
    @Transient
    public Member getPubMember() {
        return pubMember;
    }

    public void setPubMember(Member pubMember) {
        this.pubMember = pubMember;
    }

    @Id
    @Column(name = "ID", nullable = false, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "PubMemberID", nullable = true, length = 32)
    public String getPubMemberId() {
        return pubMemberId;
    }

    public void setPubMemberId(String pubMemberId) {
        this.pubMemberId = pubMemberId;
    }

    @Basic
    @Column(name = "ToMemberID", nullable = true, length = 32)
    public String getToMemberId() {
        return toMemberId;
    }

    public void setToMemberId(String toMemberId) {
        this.toMemberId = toMemberId;
    }

    @Basic
    @Column(name = "StarID", nullable = true)
    public Integer getStarId() {
        return starId;
    }

    public void setStarId(Integer starId) {
        this.starId = starId;
    }

    @Basic
    @Column(name = "PubDate", nullable = true)
    public Date getPubDate() {
        return pubDate;
    }

    public void setPubDate(Date pubDate) {
        this.pubDate = pubDate;
    }

    @Basic
    @Column(name = "Comment", nullable = true, length = 4000)
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Rate ratebean = (Rate) o;

        if (id != null ? !id.equals(ratebean.id) : ratebean.id != null) return false;
        if (pubMemberId != null ? !pubMemberId.equals(ratebean.pubMemberId) : ratebean.pubMemberId != null)
            return false;
        if (toMemberId != null ? !toMemberId.equals(ratebean.toMemberId) : ratebean.toMemberId != null) return false;
        if (starId != null ? !starId.equals(ratebean.starId) : ratebean.starId != null) return false;
        if (pubDate != null ? !pubDate.equals(ratebean.pubDate) : ratebean.pubDate != null) return false;
        if (comment != null ? !comment.equals(ratebean.comment) : ratebean.comment != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (pubMemberId != null ? pubMemberId.hashCode() : 0);
        result = 31 * result + (toMemberId != null ? toMemberId.hashCode() : 0);
        result = 31 * result + (starId != null ? starId.hashCode() : 0);
        result = 31 * result + (pubDate != null ? pubDate.hashCode() : 0);
        result = 31 * result + (comment != null ? comment.hashCode() : 0);
        return result;
    }
}
